package Dog;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("小白","白色",2);
        dog.show();
    }
}

//定义Dog类
//属性：名字、颜色、年龄
//方法show（）显示信息,返回类型void，方法名show，形参无
class Dog{
    String name,color;
    int age;
    public Dog(String name,String color,int age){
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public void show(){
        System.out.println("狗的名字叫"+this.name+"，毛发的颜色是"+this.color+"，年龄是"+this.age+"岁");
    }
}
